home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / sbin / stopstick < prev    next >
Text File  |  2006-04-04  |  1KB  |  61 lines

  1. #!/bin/sh
  2. # Script to umount the usbstick
  3.  
  4. PENTOODIR="/mnt/usbstick/pentoo/"
  5.  
  6. DOROOT=0
  7. DONESSUS=0
  8. DOETC=0
  9. DOFP=0
  10. EXIT=0
  11.  
  12. doumount() {
  13.     sync
  14.     umount -f /$1 &>/dev/null
  15. }
  16.  
  17. parse_opt() {
  18.         case "$1" in
  19.                 *\=*)
  20.                         echo "$1" | cut -f2 -d=
  21.                 ;;
  22.         esac
  23. }
  24.  
  25. dostuff() {
  26.     # Pentoo config file exist, sourcing it and linking the files...
  27.     SOFTWARE=`cat ${PENTOODIR}.pentoorc`
  28.     for x in ${SOFTWARE}
  29.     do
  30.             case "${x}" in
  31.                     root)
  32.                                DOROOT=1
  33.             ;;
  34.                        etc)
  35.                                DOETC=1
  36.                     ;;
  37.                esac
  38.     done
  39.     if [ "${DOROOT}" -eq '1' ]; then
  40.         echo "   Unmounting /root from usbstick..."
  41.         doumount root
  42.     fi
  43.     if [ "${DOETC}" -eq '1' ]; then
  44.         echo "   Unmounting /etc from usbstick..."
  45.         doumount etc
  46.     fi
  47.  
  48.     # Job done, exiting
  49. }
  50.  
  51. if [ -e /mnt/cdrom/pentoo/.pentoorc ]; then
  52.     PENTOODIR="/mnt/cdrom/pentoo/"
  53. fi
  54.  
  55. if [ -e "${PENTOODIR}".pentoorc ]; then
  56.     dostuff
  57. fi
  58.  
  59.  
  60. rm -rf /tmp/soft
  61.